#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QVector>

namespace Ui {
class Widget;
}

struct UserInfo
{
    int id;
    QString name;
    QString gender;
    int age;
};

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = nullptr);
    ~Widget();
    void showTableData();

    void updateComboBox();

    void setButtonState();

private slots:
    void on_comboBox_activated(int index);

    void on_lineEdit_editingFinished();

private:
    Ui::Widget *ui;

    QVector<UserInfo> userlist;

    int pageno = 1;  // 当前页号

    double pageSize = 4; // 每页显示条数

    double totalPage = 0; // 总页数
};

#endif // WIDGET_H
